package cartoon.room.read.room;

import android.content.Context;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;

import cartoon.room.CartoonHistoryDataBase;


@Database(entities = {CartoonReadHistoryModel.class}, version = 1, exportSchema = false)
public abstract class CartoonReadHistoryDataBase extends RoomDatabase {
    private static CartoonReadHistoryDataBase mInstance;
    private static final String  DATABASE_NAME ="carttonreadhistorys_db.db";

    public static synchronized CartoonReadHistoryDataBase getInstance(Context context){
        if(mInstance==null){
            mInstance = Room.databaseBuilder(context.getApplicationContext(),
                    CartoonReadHistoryDataBase.class,
                    DATABASE_NAME)
                    .build();
        }
        return mInstance;
    }

    public abstract CarttonReadHistoryDao getStudentDao();
}
